maximum sum of pairs with specific difference